export function getZodiacSign (dateStr) {
  const date = new Date(dateStr)
  const month = date.getMonth() + 1 // 注意月份从0开始计数，因此需要加1
  const day = date.getDate()

  if ((month === 3 && day >= 21) || (month === 4 && day <= 19)) {
    return { name: '白羊座', time: '3.21 - 4.19' }
  } else if ((month === 4 && day >= 20) || (month === 5 && day <= 20)) {
    return { name: '金牛座', time: '4.20 - 5.20' }
  } else if ((month === 5 && day >= 21) || (month === 6 && day <= 21)) {
    return { name: '双子座', time: '5.21 - 6.21' }
  } else if ((month === 6 && day >= 22) || (month === 7 && day <= 22)) {
    return { name: '巨蟹座', time: '6.22 - 7.22' }
  } else if ((month === 7 && day >= 23) || (month === 8 && day <= 22)) {
    return { name: '狮子座', time: '7.23 - 8.22' }
  } else if ((month === 8 && day >= 23) || (month === 9 && day <= 22)) {
    return { name: '处女座', time: '8.23 - 9.22' }
  } else if ((month === 9 && day >= 23) || (month === 10 && day <= 23)) {
    return { name: '天秤座', time: '9.23 - 10.23' }
  } else if ((month === 10 && day >= 24) || (month === 11 && day <= 22)) {
    return { name: '天蝎座', time: '10.24 - 11.22' }
  } else if ((month === 11 && day >= 23) || (month === 12 && day <= 21)) {
    return { name: '射手座', time: '11.23 - 12.21' }
  } else if ((month === 12 && day >= 22) || (month === 1 && day <= 19)) {
    return { name: '摩羯座', time: '12.22 - 1.19' }
  } else if ((month === 1 && day >= 20) || (month === 2 && day <= 18)) {
    return { name: '水瓶座', time: '1.20 - 2.18' }
  } else {
    return { name: '双鱼座', time: '2.19 - 3.20' }
  }
}
